#ifndef STACKVIEW_HPP
#define STACKVIEW_HPP

#include <QDockWidget>
#include <QStack>
#include <QTableWidgetItem>

namespace Ui {
    class StackView;
}

/**
* @brief
*
* @class StackView stackview.hpp "stackview.hpp"
*/
class StackView : public QDockWidget {
    Q_OBJECT
public:
    /**
    * @brief
    *
    * @fn StackView(QWidget *parent = 0)
    * @param parent
    */
    StackView(QWidget *parent = 0);

    /**
    * @brief
    *
    * @fn ~StackView
    */
    ~StackView();

    void reset();

protected:
    void changeEvent(QEvent *e);

private:
    Ui::StackView *ui;
    QStack<QTableWidgetItem*> stackItems;

    void updateView() const;

public slots:
    void onPushStack(int adress, int level);
    void onPopStack();
    void onStackOverflow();
};

#endif // STACKVIEW_HPP
